home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / util / gnu / gnu_oleo_1_2_2.lha / oleo-1.2.2 / vsprintf.c < prev    next >
C/C++ Source or Header  |  1993-03-03  |  1KB  |  50 lines

  1. /*    Copyright (C) 1993 Free Software Foundation, Inc.
  2.  
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 2, or (at your option)
  6. any later version.
  7.  
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11. GNU General Public License for more details.
  12.  
  13. You should have received a copy of the GNU General Public License
  14. along with this software; see the file COPYING.  If not, write to
  15. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  16.  
  17.  
  18. #include <stdio.h>
  19. #include <varargs.h>
  20. #include "sysdef.h"
  21.  
  22. #ifdef __STDC__
  23. #define CONST const
  24. #undef NULL
  25. #else
  26. #define CONST
  27. #endif
  28.  
  29. int
  30. vsprintf (into, s, ap)
  31.      char *into;
  32.      CONST char *s;
  33.      va_list ap;
  34. {
  35.   int ret;
  36.   auto FILE f;
  37.  
  38.   f._cnt = 32767;
  39.   f._ptr = into;
  40.   /* I am dubious of this hack for the RS/6000. */
  41. #ifdef _IOSTRG
  42.   f._flag = _IOWRT + _IOSTRG;
  43. #else    
  44.   f._flag = _IOWRT;
  45. #endif
  46.   ret = _doprnt (s, ap, &f);
  47.   *f._ptr = 0;
  48.   return (ret);
  49. }
  50.